﻿namespace BBCore.Server.Extensions
{
    public static class IpExtensions
    {
        public static string MaskIpString(this string ip)
        {
            var ret = ip;
            if (!string.IsNullOrEmpty(ip))
            {
                var index = ip.LastIndexOf('.');
                if (index > -1)
                {
                    var mask = ip[index..];
                    ret = ip.Replace(mask, ".###");
                }
            }
            return ret;
        }
    }
}
